package cn.iocoder.yudao.module.erp.dal.mysql.warehouserule;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.erp.dal.dataobject.warehouserule.WarehouseRuleDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.erp.controller.admin.warehouserule.vo.*;

/**
 * ERP 库房规则 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface WarehouseRuleMapper extends BaseMapperX<WarehouseRuleDO> {

    default PageResult<WarehouseRuleDO> selectPage(WarehouseRulePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WarehouseRuleDO>()
                .eqIfPresent(WarehouseRuleDO::getRuleType, reqVO.getRuleType())
                .eqIfPresent(WarehouseRuleDO::getRule, reqVO.getRule())
                .orderByDesc(WarehouseRuleDO::getId));
    }

}